#ifndef CLASSIFICATION_H
#define CLASSIFICATION_H

#include "cv.h"
#include "cxcore.h"
#include "ml.h"

#define NUM_CHARS   10
#define RESULT_OK   0
#define RESULT_FAIL 1

class Classification
{
public:
    Classification();
    ~Classification();

    int initializeTraining();
    int addSample(CvMat *img, int label);
    int train();
    int classify(CvMat *data);

    int classificationSave(const char* fileName);
    int classificationLoad(const char* fileName);

private:
    CvMat *imgToData(CvMat* img);

private:
    //CvSVMParams params;
    //CvSVM svm;
    CvMat* trainData;
    CvMat* labels;
    CvTermCriteria criteria;
    int numSamples;
    int maxSamples;
};

#endif // CLASSIFICATION_H
